Skip to content

chore(deploy): auto-deploy gittensory-api via Workers Builds (migrate + deploy) - #633

Merged
JSONbored merged 2 commits into
mainfrom
chore/gittensory-api-auto-deploy
Jun 12, 2026
Merged

chore(deploy): auto-deploy gittensory-api via Workers Builds (migrate + deploy)#633
JSONbored merged 2 commits into
mainfrom
chore/gittensory-api-auto-deploy

Conversation

@JSONbored

Copy link
Copy Markdown
Owner

What

Make gittensory-api (the backend worker) auto-deployable, like gittensory-ui already is.

  • deploy:api now applies pending D1 migrations then deploys: wrangler d1 migrations apply gittensory --remote && wrangler deploy. wrangler d1 migrations apply is non-interactive in CI and only applies PENDING migrations (no-op when none), so schema + code stay in sync on every build.
  • CONTRIBUTING.md documents the per-worker Workers Builds setup + recommended build-watch-paths.

Why

gittensory-api had no automated deploy — only the UI auto-deploys via Cloudflare Workers Builds — so backend merges piled up unshipped (a 71-commit / 5-day backlog, including the earn-CTA footer #620, sat stale in prod).

Follow-up (dashboard, not in this PR)

After merge: add a Workers Builds connection for gittensory-api (deploy command npm run deploy:api, build-watch-paths per CONTRIBUTING), and scope the existing gittensory-ui build's watch-paths so the two don't rebuild each other.

… (migrate + deploy)

gittensory-api (the backend worker) had no automated deploy — only gittensory-ui
auto-deploys via Cloudflare Workers Builds — so backend merges piled up unshipped
(a 71-commit/5-day backlog incl. the earn-CTA footer). Make deploy:api the
canonical backend deploy that applies pending D1 migrations then deploys, so a
Workers Builds connection (deploy command: npm run deploy:api) keeps schema + code
in sync on every push. wrangler d1 migrations apply is non-interactive in CI and
only applies PENDING migrations (no-op when none). Document the per-worker
Workers Builds setup + build-watch-paths in CONTRIBUTING.
@ghost

ghost commented Jun 12, 2026

Copy link
Copy Markdown

Note

Gittensory Gate skipped

PR closed before full evaluation. No late first comment was created.

Signal Result Evidence Action
Gate result ⚠️ Skipped #633 is no longer open. No action.

💰 Earn for open-source contributions like this. Gittensor lets GitHub contributors earn for the work they already do — register to start earning →.

Checked by Gittensory, a quiet PR intelligence layer for OSS maintainers.

@ghost ghost added the gittensory:reviewed label Jun 12, 2026
@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Jun 12, 2026

Copy link
Copy Markdown

Deploying with  Cloudflare Workers  Cloudflare Workers

The latest updates on your project. Learn more about integrating Git with Workers.

Status Name Latest Commit Preview URL Updated (UTC)
✅ Deployment successful!
View logs
gittensory-ui a348bbd Commit Preview URL

Branch Preview URL
Jun 12 2026, 07:40 PM

@ghost ghost added the gittensory-review label Jun 12, 2026

@ghost ghost left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Gittensory review · advisory — a maintainer merges

0 actionable · 2 nitpick(s) · 2 file(s) · two independent AI reviewers

Suggested action:Safe to merge — both reviewers found no blocking issues.

📋 Walkthrough

The PR modifies package.json to run remote D1 migrations before deploying the API worker, and updates CONTRIBUTING.md to reflect the new automatic deployment workflow and watch‑path recommendations.

Changes

File Summary
package.json Changed deploy:api script to run wrangler d1 migrations apply gittensory --remote before wrangler deploy.
CONTRIBUTING.md Rewrote deployment section to describe automatic deployments for both workers, added details on the new deploy:api command and watch‑path configuration.
🔍 Reviewer notes

Reviewer A · gpt-oss-120b — recommends ✅ merge
This PR updates the deployment script to apply pending D1 migrations before deploying the API worker and expands the CONTRIBUTING guide to document the new automatic deployment process.

Suggestions

  • Add a comment in the script or docs noting that wrangler d1 migrations apply must be non‑interactive and only apply pending migrations to avoid accidental schema changes.
  • Consider adding a CI step that verifies the deploy:api script runs without error in a dry‑run mode to catch credential or migration issues early.

Worth double-checking

  • Remote migrations running on every CI deploy could cause race conditions if multiple builds deploy concurrently.
  • If credentials for remote D1 access are misconfigured, the deployment could fail or partially apply migrations.

Reviewer B · nemotron-3-120b-a12b — recommends ✅ merge
The PR updates the API deploy script to run D1 migrations before deployment and clarifies Cloudflare Workers Builds usage in CONTRIBUTING.md. Changes are limited to package.json scripts and documentation, with no code or behavior changes. The migration step is safe (non-interactive, pending-only) and documentation improvements are helpful.

Worth double-checking

  • Ensure migration scripts are backward-compatible and testable locally (though existing db:migrate scripts cover this).
  • Verify that wrangler d1 migrations apply --remote is non-interactive in CI (standard behavior).

🤖 Automated advisory review · a maintainer makes the final call.

@JSONbored JSONbored self-assigned this Jun 12, 2026

@ghost ghost left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Gittensory review · advisory — a maintainer merges

0 actionable · 2 nitpick(s) · 2 file(s) · two independent AI reviewers

Suggested action:Safe to merge — both reviewers found no blocking issues.

📋 Walkthrough

The PR modifies the deploy:api npm script to run pending D1 migrations on the remote database before deploying the Cloudflare worker, and updates CONTRIBUTING.md to describe the new automatic deployment workflow for both API and UI workers.

Changes

File Summary
package.json Changed deploy:api script to run remote D1 migrations before wrangler deploy.
CONTRIBUTING.md Updated deployment documentation to reflect automatic deployments for both workers and added details on the new deploy:api command and watch-paths.
🔍 Reviewer notes

Reviewer A · gpt-oss-120b — recommends ✅ merge
This PR updates the deployment script to run pending D1 migrations before deploying the API worker and expands the CONTRIBUTING guide to document the new automatic deployment process. The changes are limited to scripts and documentation, with no code impact.

Suggestions

  • Add a note in the CI workflow to fail fast if wrangler d1 migrations apply returns an error, ensuring a broken migration stops the deploy.
  • Consider adding a brief comment in package.json explaining why the remote migration step is needed for future maintainers.

Worth double-checking

  • Automatic remote migrations could apply unintended schema changes if a migration is added without proper review.
  • If a migration fails, the deploy will also fail; ensure CI reports this clearly.

Reviewer B · nemotron-3-120b-a12b — recommends ✅ merge
This PR automates deployment of the gittensory-api worker by updating the deploy:api script to run pending D1 migrations before wrangler deploy, and updates CONTRIBUTING.md to document the new Cloudflare Workers Builds setup for both API and UI workers. The change is safe, improves deployment reliability, and maintains the public/private boundary as it only affects internal deployment processes.

No blocking issues spotted.


🤖 Automated advisory review · a maintainer makes the final call.

@superagent-security

Copy link
Copy Markdown
Contributor

Superagent didn't find any vulnerabilities or security issues in this PR.

@JSONbored
JSONbored merged commit 4caf2b6 into main Jun 12, 2026
10 of 11 checks passed
@JSONbored
JSONbored deleted the chore/gittensory-api-auto-deploy branch June 12, 2026 19:39
@github-project-automation github-project-automation Bot moved this from Todo to Done in gittensory - v1 roadmap Jun 12, 2026
@dosubot dosubot Bot added the size:S label Jun 12, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

No open projects
Status: Done

Development

Successfully merging this pull request may close these issues.

1 participant